package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GaAlarmMapper;
import com.ruoyi.system.domain.GaAlarm;
import com.ruoyi.system.service.IGaAlarmService;

/**
 * 报警Service业务层处理
 * 
 * @author wzp
 * @date 2021-11-18
 */
@Service
public class GaAlarmServiceImpl implements IGaAlarmService 
{
    @Autowired
    private GaAlarmMapper gaAlarmMapper;

    /**
     * 查询报警
     * 
     * @param id 报警主键
     * @return 报警
     */
    @Override
    public GaAlarm selectGaAlarmById(Long id)
    {
        return gaAlarmMapper.selectGaAlarmById(id);
    }

    /**
     * 查询报警列表
     * 
     * @param gaAlarm 报警
     * @return 报警
     */
    @Override
    public List<GaAlarm> selectGaAlarmList(GaAlarm gaAlarm)
    {
        return gaAlarmMapper.selectGaAlarmList(gaAlarm);
    }

    /**
     * 新增报警
     * 
     * @param gaAlarm 报警
     * @return 结果
     */
    @Override
    public int insertGaAlarm(GaAlarm gaAlarm)
    {
        gaAlarm.setCreateTime(DateUtils.getNowDate());
        return gaAlarmMapper.insertGaAlarm(gaAlarm);
    }

    /**
     * 修改报警
     * 
     * @param gaAlarm 报警
     * @return 结果
     */
    @Override
    public int updateGaAlarm(GaAlarm gaAlarm)
    {
        return gaAlarmMapper.updateGaAlarm(gaAlarm);
    }

    /**
     * 批量删除报警
     * 
     * @param ids 需要删除的报警主键
     * @return 结果
     */
    @Override
    public int deleteGaAlarmByIds(Long[] ids)
    {
        return gaAlarmMapper.deleteGaAlarmByIds(ids);
    }

    /**
     * 删除报警信息
     * 
     * @param id 报警主键
     * @return 结果
     */
    @Override
    public int deleteGaAlarmById(Long id)
    {
        return gaAlarmMapper.deleteGaAlarmById(id);
    }

    @Override
    public List<GaAlarm> selectGaAlarmStudentList(Long creatUser) {
        GaAlarm gaAlarm = new GaAlarm();
        gaAlarm.setCreateUser(creatUser);
        return gaAlarmMapper.selectGaAlarmList(gaAlarm);
    }
}
